home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
tools
/
czesc_2
/
justlook
/
examples
/
examplesources
/
goovericon.jl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-12-04
|
1KB
|
52 lines
/* GoOverIcon.jl By Kamran Karimi
Should be linked with JustLook (© Kamran Karimi) routines.
*/
#include <stdlib.h>
#include <stdio.h>
#include <intuition/intuition.h>
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <clib/intuition_protos.h>
#include "JustLook.h"
struct IntuitionBase *IntuitionBase = NULL;
struct Library *IconBase = NULL;
#define Write_err printf("err = %0lx\n",err)
main()
{
struct Window *win;
ErrorCode err;
struct ScrMap SM;
IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0);
if(IntuitionBase == 0) exit(100);
IconBase = OpenLibrary("icon.library",0);
if(IconBase == 0) exit(99);
win = FindWindow("Workbench",NULL);
if(win > WIN_REPEATED)
{
WindowToFront(win);
InitSM(&SM,win->WScreen);
err = GoOverIcon(&SM,win,"DH0:Disk");
Write_err;
Delay(50);
err = Click(&SM,LBUTTON,0,DOWN_UP);
Write_err;
err = Click(&SM,LBUTTON,0,DOWN_UP);
Write_err;
}
else
{
if (win == WIN_REPEATED) printf("Two Workbench windows are open!!!\n");
else printf("Workbench window not found!\n");
}
CloseLibrary((struct Library *)IntuitionBase);
exit(0);
}